import React, { Component } from 'react'

export default class App extends Component {
  state = {
    firstName: '吴',
    lastName: '大勋'
  }

  render() {
    return (
      <div>
        <input onChange={ (event) => {
          console.log(event.target.value)
          this.setState({
            firstName: event.target.value
          })
        } } value={ this.state.firstName } type="text" placeholder="姓" /> +
        <input onChange={ (event) => {
          console.log(event.target.value)
          this.setState({
            lastName: event.target.value
          })
        } } value={ this.state.lastName } type="text" placeholder="名" /> =
        { this.state.firstName + this.state.lastName }
      </div>
    )
  }
}
